<template>
  <Viewer :value="props.value" :plugins="plugins"/>
</template>

<script setup lang="ts">
import gfm from "@bytemd/plugin-gfm";
import highlight from "@bytemd/plugin-highlight";
import {Viewer} from "@bytemd/vue-next";
import {withDefaults, defineProps} from "vue";

/**
 * 定义组件属性类型
 */
interface Props {
  value: string;
}

const plugins = [
  gfm(),
  highlight(),
  // Add more plugins here
];

/**
 * 给组件指定初始值
 */
const props = withDefaults(defineProps<Props>(), {
  value: () => "",
});
</script>

<style>

.markdown-body {
  font-size: 14px;
  color: #262626;
  line-height: 1.5;
}

.markdown-body blockquote {
  border-left: 2px solid #EBEBEB !important;
}

.markdown-body blockquote p {
  font-family: Menlo, sans-serif !important;
  margin-bottom: 0;
}

.markdown-body blockquote p strong {
  color: #262626;
  font-weight: 700;
}
</style>
